////////////////////////////////////////////////////////////////////////////
// Program:  GiTMbot
// Author:   GiTM.soccerist
// Begin-Programming-date: 3/16/04

// Description: This is a binary chat client for login into bnetd chat
// servers.  It was not designed to be fool-proof or broken-proof.
// This software is created "as is" and I can not be responsible for
// anything that it does to your computer.  Use at your own risk!
//
// Final words: 
// As of now there are two hardcoded values in this code
// (that I am aware of).  The first is the u32 versionByte that is
// part of packet 0x50 (SID_AUTH_INFO).  The second hardcoded value is
// the u32 exeVer which is part of packet 0x51 (SID_AUTH_CHECK).  It
// kinda sucks that it has to be like this and that it must be
// recompiled each time with the correct values.  If you can fix it,
// fix it!
//
//
// TODO's, Notes, & Things to think about:  
//
#define GITMCHAT_VERSION "1.0.0"

#include<iostream>
#include<string>

using namespace std;

#include <qapplication.h>
#include "bot/bot.h"


void printUsage();

////////////////////////////////////////////////////////////////////////////
// Main
//
int main(int argc, char *argv[]) {
  cout << "Welcome to GiTMchat.  " << endl;
  
  // Check the runtime cmd arguments and set the global variables
  // accordingly.  (What settings and run modes.)
  if(argc > 1) 
  {
      for(int i=1; i < argc; i++) 
      {
          if((string(argv[i]) == "--version") || 
             (string(argv[i]) == "-v")) 
          {
              cout << "GiTMchat version " << GITMCHAT_VERSION 
                   << " brought to you by GiTM.soccerist" << endl << endl;
              return 0;
          }
      }
  }
  
  QApplication app(argc, argv);

  QIcon icon( "gitm.png" );
  app.setWindowIcon( icon );

  bot *someBot = new bot;

  app.setMainWidget(someBot);
  app.connect(&app, SIGNAL(lastWindowClosed()),
	      &app, SLOT(quit()));
  return app.exec();
}


void printUsage()
{
    cout << "Usage:  " << endl
         << "GiTMchat [-v | --version]"
         << endl;
}
